<%@ taglib uri="/taglib/tags/jstl/c" prefix="c"%>
<%@ taglib uri="/buyman" prefix="buyman"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
	<base href='${path}'/>
<head>
	
	<!-- CSS links UI jquery -->
  	<link href='<c:url value="interfaceFramework/css/buyman/jquery-ui-1.8.7.custom.css"/>' rel="stylesheet" type="text/css" />
	
	<script language='javascript' src='<c:url value="js/general/jshashtable.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/json.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/MyClass.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/MyFileUploader.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/MyAjax.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/MyUtils.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/MyBoundingHandler.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/Utils.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/Cache.js"/>'></script>
	<script language='javascript' src='<c:url value="js/general/MyDate.js"/>'></script>
	<script language='javascript' src='<c:url value="js/Ticket.js"/>'></script>
	<script language='javascript' src='<c:url value="js/DetalleProveedor.js"/>'></script>
	<script language='javascript' src='<c:url value="js/Logo.js"/>'></script>
	<script language='javascript' src='<c:url value="js/TabProductos.js"/>'></script>
	<script language='javascript' src='<c:url value="js/TabGenerico.js"/>'></script>
	<script language='javascript' src='<c:url value="js/ChatBar.js"/>'></script>
	<script language='javascript' src='<c:url value="js/EdicionSitio.js"/>'></script>
	<script language='javascript' src='<c:url value="js/Login.js"/>'></script>
	<script language='javascript' src='<c:url value="js/ChatButton.js"/>'></script>
	<script language='javascript' src='<c:url value="js/Publicidad.js"/>'></script>
	<script language='javascript' src='<c:url value="js/MiniTabs.js"/>'></script>
	<script language='javascript' src='<c:url value="js/ResourceMapConfiguracionSitio.js"/>'></script>
	
	<!-- CSS links -->
	<link href='<c:url value="templates/css/layout.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/provider.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/reset.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/typography.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/formmodifiers.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/fxs.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/buybuttons.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/sponsors.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/scrolltable.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/datalist.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="templates/css/editListbuttons.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/social/social.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/slider/slider.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/tabs/tabs.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/ticket/ticket.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/ticket/ticket2.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/addthis/addthis.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/shareit/shareit.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/countquantity/countquantity.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/videoslider/videoslider.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/slidetoggle/slidetoggle.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/toolstoggle/toolstoggle.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/sortlist/sortlist.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/library/library.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/combowizard/combowizard.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/search/search.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/editing/editing.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/trashing/trashing.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/promo/promo.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/switch/switch.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/reputation/reputation.css"/>' rel="stylesheet" type="text/css" />
		
	<link href='<c:url value="templates/css/variations/blue.css"/>' rel="stylesheet" type="text/css" />
    
    <!-- Uso de jQuery -->
    <script language='javascript' src='<c:url value="interfaceFramework/js/jquery-1.4.4.min.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.core.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.widget.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.tabs.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/external/jquery.bgiframe-2.1.2.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.mouse.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.button.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.draggable.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.sortable.js"/>'></script>	
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.position.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.resizable.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.ui.dialog.js"/>'></script>
	<script language='javascript' src='<c:url value="interfaceFramework/ui/jquery.effects.core.js"/>'></script>
	
	<!-- growl -->
    <script type="text/javascript" src="plugins/growl/js/growl.js"></script>
	<link rel="stylesheet" type="text/css" href="plugins/growl/css/growl.css"/>

	<!-- comentarios -->
	<link rel="stylesheet" type="text/css" href="plugins/comentarios/comentarios.css"/>

	<!-- PLUGIN COUNTDOWN -->
	<script language='javascript' src='<c:url value="plugins/countdown/jquery.countdown.min.js"/>'></script>
	<script language='javascript' src='<c:url value="plugins/countdown/languages/jquery.countdown-es.js"/>'></script>
	<link href='<c:url value="plugins/countdown/countdown.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- PLUGIN GALLERIFFIC -->
	<script type='text/javascript' src='<c:url value="plugins/galleriffic/jquery.galleriffic.js"/>'></script>
	<script type='text/javascript' src='<c:url value="plugins/galleriffic/jquery.opacityrollover.js"/>'></script>
	
	<!-- PLUGIN UPLOADIFY -->
	<link href='<c:url value="plugins/uploadify/uploadify.css"/>' rel="stylesheet" type="text/css" />
	<script type='text/javascript' src='<c:url value="plugins/uploadify/swfobject.js"/>'></script>
	<script type='text/javascript' src='<c:url value="plugins/uploadify/uploadify_v2.1.4.min.js"/>'></script>
		
	<!-- QTIP -->
	<script language='javascript' src='<c:url value="plugins/jqueryqtip/jqueryqtip.js"/>'></script>
	
	<!-- TIPSY -->
	<link href='<c:url value="plugins/tipsy/tipsy.css"/>' rel="stylesheet" type="text/css" />
	<script language='javascript' src='<c:url value="plugins/tipsy/jquery.tipsy.js"/>'></script>
	
	<!-- SHORTEN -->
	<script language='javascript' src='<c:url value="plugins/shorten/jquery.shorten.min.js"/>'></script>
	
	<!-- ELLIPSIS -->
	<script language='javascript' src='<c:url value="plugins/ellipsis/jquery.ellipsis.js"/>'></script>
	
	<!-- CUPONSLIDER -->
	<link href='<c:url value="plugins/cuponslider/cuponslider.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- NAVMENU -->
	<link href='<c:url value="plugins/navmenu/nav-h.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- VIEWS -->
	<link href='<c:url value="plugins/views/views.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- RATING -->
	<link href='<c:url value="plugins/rating/rating.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- MODALWINDOW -->
	<link href='<c:url value="plugins/modalwindow/modalwindow.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- SHAREBAR -->
	<link href='<c:url value="plugins/sharebar/sharebar.css"/>' rel="stylesheet" type="text/css" />
	<script language='javascript' src='<c:url value="plugins/sharebar/sharebar.js"/>'></script>
	
	<!-- OUTOFSTOCK -->
	<link href='<c:url value="plugins/outofstock/outofstock.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- MENUVIEW -->
	<link href='<c:url value="plugins/menuview/menuview.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- GBUTTONS -->
	<link href='<c:url value="plugins/gbuttons/gbuttons.css"/>' rel="stylesheet" type="text/css" />
	
	<!-- LOADER -->
	<script language='javascript' src='<c:url value="plugins/loader/bridge.js"/>'></script>
	<script language='javascript' src='<c:url value="plugins/loader/adapters/jquery.js"/>'></script>
	<script language='javascript' src='<c:url value="plugins/loader/adapters/shared.js"/>'></script>
	<script language='javascript' src='<c:url value="plugins/loader/spinners.js"/>'></script>
	
<%--	<script src='<c:url value="plugins/mapa/MyLibraryManager.js"/>' type="text/javascript"></script>--%>
<%--	<script src='<c:url value="plugins/mapa/DinamicIncludes_Map.js"/>' type="text/javascript"></script>--%>
	<link href='<c:url value="plugins/mapa/popups.css"/>' rel="stylesheet" type="text/css" />
	<link href='<c:url value="plugins/mapa/theme/default/style.css"/>' rel="stylesheet" type="text/css" />
<%--	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=es"></script>--%>
	
	<!-- CHAT -->
	<link href='<c:url value="plugins/chat/chat.css"/>' rel="stylesheet" type="text/css" />
	<script language='javascript' src='<c:url value="plugins/chat/swfobject.js"/>'></script>
		
	<!-- TABS -->
	<script type="text/javascript">
	<%--***************PARA EL MAPA**************************--%>
		function verAtributos(obj, recursivo){
			for(x in obj){
				alert("atributo: "+x+" - valor: "+obj[x]);
				if(typeof(obj[x])=="object" && recursivo){
					verAtributos(obj[x], recursivo);
				}
			}
		}
		function indexOfArray(arrays, obj){
			for(var i=0; i<arrays.length; i++){
       			if(arrays[i]==obj){
		            return i;
       			}
		    }
		    return -1;
		}
//		var CAMBIO_DE_MAPA 	= 1;
//		var callesUrl = null;
//		var callesParams = null;
//		var callesOptions = null;
//		var mapIcons 		= null;
//		var mapServersList 	= new Array();
//		var cMapController = null;
//		var toMapType = ""; //"google";
		parent.callesUrl = null;
		parent.callesParams = null;
		parent.callesOptions = null;
		parent.mapIcons 		= null;
		parent.mapServersList 	= new Array();
		parent.cMapControl = null;
		parent.toMapType = ""; //"google";

	<%--*****************************************--%>
		
		$(document).ready(function() {
			//Al cargarse la pagina ejecutar...
			
			if (window.parent.userToolBar != undefined)
			{
				$(document).click(function() {
					window.parent.userToolBar.onDocumentClick();
				});
			
				window.parent.userToolBar.pagina = 'homeprovider';
				window.parent.userToolBar.idProveedor = "${idProveedor}";
				window.parent.userToolBar.modoUsuario();
			}
			
			
			//Tabs menu
<%--			$(".tab_content").hide(); //Oculta todos los contenedores de los tabs--%>
<%--			$("ul.tabs li:first").addClass("active").show(); //Activa el primer tab--%>
<%--			$(".tab_content:first").show(); //Muestra el contenido del primer tab--%>

			$("ul.tabs li").click(function() {
				$("ul.tabs li").removeClass("active"); //Remove any "active" class
				$(this).addClass("active"); //Add "active" class to selected tab
				$(".tab_content").hide(); //Hide all tab content
		
				var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
//				if(activeTab=="#map"){
//					dinamicIncludes_Map.includePreload();
//				}
				$(activeTab).fadeIn( function() {
													if(activeTab=="#map"){
														iniciarMapa();
													}
												} ); //Fade in the active ID content
				if(activeTab=="#cupon_tabgenerico"){
					$(activeTab).find('#cupon #slider1 li p').ellipsis();
				}
				return false;
			});
			
			//Tabs service
			
			$("ul#navmenu-h li.tab_simple").live('click',function() {
				tabProductos.entrarSeccionSimple ($(this));
				return false;
			});
			
			$("ul#navmenu-h li.tab_categoria").live('click',function() {
				tabProductos.entrarCategoria ($(this));
				return false;
			});
			
			$("ul#navmenu-h li.tab_more_simple").live('click',function() {
				tabProductos.entrarSeccionSimple ($(this));
				return false;
			});
			
			$("ul#navmenu-h li.tab_more_categoria").live('click',function() {
				tabProductos.entrarCategoria ($(this));
				return false;
			});
			
			//Video list slider
			$(".video_thumb ul li:first").addClass('active'); 
			$(".video_thumb ul li").click(function(){ 
				//Variables
				var imgAlt = $(this).find('img').attr("alt"); //Get Alt Tag of Image
				var imgTitle = $(this).find('a').attr("href"); //Get Main Image URL
				
				if ($(this).is(".active")) {  //If it's already active, then...
					return false; // Don't click through
				} else {
					//Pasa los parametros al videoslider_video
					$(".videoslider_video img").attr({ src: imgTitle , alt: imgAlt});
				}
				
				$(".video_thumb ul li").removeClass('active'); //Remove class of 'active' on all lists
				$(this).addClass('active');  //add class of 'active' on this list only
				return false;
				
			}) .hover(function(){
				$(this).addClass('hover');
				}, function() {
				$(this).removeClass('hover');
			});
			//End Video list slider ------>
		   	
		   	//Toolstoggle edicion: product/service
			$(".btn-toolstoggle").live('click',function(){
				$("#toolstogglepanel").slideToggle("slow");
				$(this).toggleClass("swap"); return false;
			});
			
		   	tabProductos.filtrarProductos();


	        window.fbAsyncInit = function() {
	    		FB.init({appId: '38c7bdf8aa333a486cb69f4ad981a510', status: true, cookie: true, xfbml: true, logging:false});
	    	};
			(function() {
				var e = document.createElement('script'); e.async = true;
				e.src = document.location.protocol + '//connect.facebook.net/es_ES/all.js';
				document.getElementById('fb-root').appendChild(e);
			}());
    	
		});
	</script>
	
	<!-- TICKET SCROLL FLOAT TO TOP -->
	<script type="text/javascript">
		$(function() {
			var offset = $("#ticket").offset();
			var topPadding = 5;
			$(window).scroll(function() {
				if ($(window).scrollTop() > offset.top) {
					$("#ticket").stop().animate({
						marginTop: $(window).scrollTop() - offset.top + topPadding
					});
				} else {
					$("#ticket").stop().animate({
						marginTop: 0
					});
				};
			});
		});
	</script>
	
	<script type="text/javascript">

		function logoClick ()
		{
			$.ajax({
				url: path + 'loadPage.act',
				data: 	'funcion=descargarProveedor',
				type: 'POST',
				success: function(content) {
					location.href = path2 + content; 
				}
			});
		}
		
	</script>
	
</head>

<buyman:initial/>
<buyman:login idProveedor="${idProveedor}" idUsuario="${idUsuario}" pagina="homeprovider"/>
<body id="page" class="background column-right">
  	
  	<iframe id="uploadFrameID" name="uploadFrame" height="0" width="0" frameborder="0" scrolling="yes"></iframe>
	
	<div id="absolute"> </div>
	
	<div id="page-body">
		<div class="wrapper">
		
			<div id="header">

				<div id="logo-buyman-provider" class="comercios" onclick='logoClick()'></div>
				
				<div id="headerbar">
				
					<buyman:miniTabs idUsuario="${idUsuario}"/>
             				
				</div>
				
				<buyman:logo idProveedor="${idProveedor}"/>
								
       			<buyman:detalleProveedor idProveedor="${idProveedor}"/>

      			<buyman:tabGenerico idProveedor="${idProveedor}" modo="${modo}" idUsuario="${idUsuario}"/>
      			
			</div>
			
			<!--SECCION MEDIO-->
			<div id="middle">
				<div id="columns">
			    	
			    	<!--SECCION IZQ-->
			    	<div class="col1">
	    			
			        	<buyman:connected idProveedor="${idProveedor}"/>
			    		
			           	<buyman:chatButton idProveedor="${idProveedor}" idUsuario="${idUsuario}"/>
			    		
			    		<buyman:ticket idProveedor="${idProveedor}" idUsuario="${idUsuario}" idPedido="${idPedido}"/>
			    		
			    		<p>&nbsp;</p>
			    	</div>
			    	
			    	<!--SECCION MEDIO-->
			    	<div class="col2">
			    		<buyman:tabProductos idProveedor="${idProveedor}" modo="${modo}" idUsuario="${idUsuario}"/>
			    	</div>
			    	
			    	<!--SECCION DER-->
			    	<div class="col3">
			    		
			    		<buyman:socialBar idProveedor="${idProveedor}" idUsuario="${idUsuario}"/>
			    		
			    		<buyman:edicionSitio idProveedor="${idProveedor}" idUsuario="${idUsuario}"/>
			    		
			    		<!-- SPONSORS / BANNERS -->
			    		<buyman:publicidad idProveedor="${idProveedor}"/>
			    		
			    	</div>
			    </div>	
			</div>
		</div>
	</div>
  	
	<div id="fb-root"></div>

</body>

</html>